// Threads
// (c) jimon game studio

#ifndef JEH_JETHREADS
#define JEH_JETHREADS

#include "Config_Engine.h"

#ifdef JE_THREADS
#include <omp.h>
#endif

namespace je
{
	#ifdef JE_THREADS
		#define JE_THREAD_CRITICAL omp critical
		#define JE_THREAD_ATOMIC omp atomic
		#define JE_THREAD_BARRIER omp barrier
		#define JE_THREAD_MASTER omp master
		#define JE_THREAD_SINGLE omp single
		#define JE_THREAD_FOR omp for
		#define JE_THREAD_SECTION omp section
		#define JE_THREAD_PARALLEL omp parallel
		#define JE_THREAD_FLAG_SECTIONS sections
		#define JE_THREAD_FLAG_NUMTHREADS num_threads
		#define JE_THREAD_FLAG_SHARED shared
	#else
		#define JE_THREAD_CRITICAL
		#define JE_THREAD_ATOMIC
		#define JE_THREAD_BARRIER
		#define JE_THREAD_MASTER
		#define JE_THREAD_SINGLE
		#define JE_THREAD_FOR
		#define JE_THREAD_SECTION
		#define JE_THREAD_PARALLEL
		#define JE_THREAD_FLAG_SECTIONS
		#define JE_THREAD_FLAG_NUMTHREADS
		#define JE_THREAD_FLAG_SHARED
	#endif
}

#endif
